package com.usian.admin.controller.v1;

import com.usian.admin.service.AdSensitiveService;
import com.usian.apis.admin.SensitivecontrollerApi;
import com.usian.model.admin.dtos.SensitiveDto;
import com.usian.model.admin.pojos.AdSensitive;
import com.usian.model.common.dtos.ResponseResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/api/v1/sensitive")
public class AdSensitiveController implements SensitivecontrollerApi {
    @Autowired
    private AdSensitiveService adSensitiveService;
    @PostMapping("/list")
    @Override
    public ResponseResult list(SensitiveDto dto) {
        return adSensitiveService.list(dto);
    }
    @PostMapping("/save")
    @Override
    public ResponseResult save(AdSensitive adSensitive) {
        return adSensitiveService.insert(adSensitive);
    }
    @PostMapping("/update")
    @Override
    public ResponseResult updata(AdSensitive adSensitive) {
        return adSensitiveService.updata(adSensitive);
    }
    @PostMapping("/del/{id}")
    @Override
    public ResponseResult deleteById(@PathVariable("id") Integer id) {
        return adSensitiveService.deleteById(id);
    }
}
